<template>
  <div id="app">
    <my-header :seller="seller"></my-header>
    <my-tab></my-tab>
    <router-view :goods="goods" :seller="seller" :ratings="ratings"></router-view>
  </div>
</template>

<script>
import MyHeader from '@/components/header/header.vue'
import MyTab from '@/components/tab/tab.vue'
import axios from 'axios'

export default{
  data() {
    return {
      seller:{},
      goods:[],
      ratings:[]
    }
  },
  components:{
    MyHeader,
    MyTab
  },
  methods:{
    getInfo(){
      axios.get('/api/data.json').then(this.getInfoSucc)
    },
    getInfoSucc(res){
      if(res.data){
        this.seller=res.data.seller
        this.goods=res.data.goods
        this.ratings=res.data.ratings
        //console.log(res.data.goods[0].foods[0].description)
        //console.log(res.data.seller)
      }
    }
  },
  mounted(){
    this.getInfo()
  }
}

</script>

<style lang="stylus" scoped>


</style>
